// src/models/launches.model.js
const launches = new Map();
let latestFlightNumber = 100;
const launch = {
    flightNumber: 100,
    mission: 'Kepler Exploration X',
    rocket: 'Explorer IS1',
    launchDate: new Date('December 27, 2030'),
    target: 'Kepler-442 b', // 修改为 target
    customer: ['GKD', 'NASA'],
    upcoming: true,
    success: true,
    };
launches.set(launch.flightNumber, launch);
function existsLaunchWithId(launchId) {
    return launches.has(launchId);
}
// 取消指定 ID 的发射任务
function abortLaunchById(launchId) {
    const aborted = launches.get(launchId);
    aborted.upcoming = false;
    aborted.success = false;
    return aborted;
}
module.exports = {
    existsLaunchWithId,
    getAllLaunches,
    addNewLaunch,
    abortLaunchById,
};